<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>API接口</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="lfly" />
<link rel="stylesheet" type="text/css" href="../cache/templates/default.style.css" />
<style type="text/css">
	html {
		overflow: auto;
	}
	#root_headtop {
		background:url("../images/headbg.gif") repeat-x 0 0;
	}
	#root_mainshow {
		margin: 10px;
		line-height: 25px;
	}
	#root_mainshow dl {
		margin: 10px 0 0 0;
		background-color: #efefef;
	}
	#root_mainshow dl dt {
		background-color: #6CC4B6;
		color: #ffffff;
		padding: 1px 5px;
		font-weight: 700;
	}
	#root_mainshow dl dt a {
		float: right;
		color: #fff;
	}
	#root_mainshow .api_group_guest dl dt {
		background-color: #0AAA00;
	}
	#root_mainshow .api_group_member dl dt {
		background-color: #3B4DAA;
	}
	#root_mainshow .api_group_activity dl dt {
		background-color: #ff6600;
	}
	#root_mainshow dl dd span {
		background-color: #FFFF00;
		padding: 5px;
		margin: 0 3px 0 0;
	}
	#root_mainshow dl dd.datain span {
		background-color: #00FF00;
	}
	.apiurl {
		background-color: #cccccc;
		font-style: italic;
	}
	.datain {
		background-color: #e0e0e0;
	}
	.new {
		padding-left: 20px;
		color: red;
	}
</style>
</head>
<body>
<div id="root_headtop" class="autoclear">
	<div id="root_headtop_logo"><img src="../images/logo.gif" alt="" class="vamiddle" /></div>
	<div id="root_headtop_title">API接口</div>
	<div id="root_headtop_info">Updated Time: 2013-07-02</div>
</div>
<div id="root_mainshow">

<div class="showinfo">
<b>输入统一的参数</b> param={标准json格式}	（注意标准格式和url编码）<br />
<b>输出统一的格式</b> {"code":"-1系统错误 0正常 1逻辑错误 >1类型错误 10000需重新登录","msg":"错误信息","data":"正常json数据"}<br />
注意接口的 <i>http://lfly.cn/demo/princesswedding/api/</i> 地址为测试地址，正式版本会修改，请注意灵活设计。
</div>

<a name="nav"></a>
<div class="autoclear">
	<div style="width: 200px;float:left;margin-right:10px;">
		<dl>
			<dt>全局接口</dt>
			<dd><a href="#api_name_start">获取全局和首页信息</a><i class="new">up!</i></dd>
			<dd><a href="#api_name_cover">获取首页图片</a></dd>
		</dl>
	</div>
	<div class="api_group_guest" style="width: 200px;float:left;margin-right:10px;">
		<dl>
			<dt>匿名用户接口</dt>
			<dd><a href="#api_name_signup">用户注册</a></dd>
			<dd><a href="#api_name_signin">用户登录</a></dd>
			<dd><a href="#api_name_findpassword">找回密码</a></dd>
		</dl>
	</div>
	<div class="api_group_member" style="width: 200px;float:left;margin-right:10px;">
		<dl>
			<dt>注册会员接口</dt>
			<dd><a href="#api_name_profile">获取用户资料</a></dd>
			<dd><a href="#api_name_changeprofile">修改用户资料</a></dd>
			<dd><a href="#api_name_checkcode">校验验证码</a></dd>
			<dd><a href="#api_name_ischeckcode">查询用户验证码状态</a></dd>
		</dl>
	</div>
	<div class="api_group_activity" style="width: 200px;float:left;margin-right:10px;">
		<dl>
			<dt>活动信息接口</dt>
			<dd><a href="#api_name_activity">获取活动信息</a></dd>
			<dd><a href="#api_name_activityhtml">获取活动html页面</a></dd>
			<dd><a href="#api_name_site">获取活动场所列表</a></dd>
			<dd><a href="#api_name_reserve">用户预定活动场所</a></dd>
			<dd><a href="#api_name_myreserve">查询用户选定的场所</a><i class="new">up!</i></dd>
			<dd><a href="#api_name_ischange">查询更换预定状态</a><i class="new">new!</i></dd>
		</dl>
	</div>
</div>

<!-- 全局 -->
<div class="api_group_other">
	<a name="api_name_start"></a>
	<dl id="api_show_start">
		<dt><a href="#nav">[↑]</a>获取全局和首页信息</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/start.php</dd>
		<dd class="datain"><span>输入</span>无</dd>
		<dd><span>输出</span>
<pre>
{
  "gift":{
           "id":"活动ID",
           "title":"活动标题",
           "giftpic":"礼品图片",
           "giftinfo":"礼品介绍"
         },
  "member":{  （未登录 member 为 null）
             "uid":"用户ID",
             "truename":"姓名",
             "email":"电子邮件",
             "mobile":"移动电话",
             "weddingdate":"结婚时间"
           },
  "ischeckcode":true | false,
  "isReserved":true | false,
  "message":{
           "isReservedTimeOut":"活动即将开始不能更改的提示消息"
         }
}
</pre>
		</dd>
	</dl>

	<a name="api_name_cover"></a>
	<dl id="api_show_cover">
		<dt><a href="#nav">[↑]</a>获取首页图片</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/cover.php</dd>
		<dd class="datain"><span>输入</span>无</dd>
		<dd><span>输出</span>图像信息
		</dd>
	</dl>
</div>

<!-- 匿名用户 -->
<div class="api_group_guest">
	<a name="api_name_signup"></a>
	<dl id="api_show_signup">
		<dt><a href="#nav">[↑]</a>用户注册</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/guest/signup.php</dd>
		<dd class="datain"><span>输入</span>
<pre>
{
  "truename":"姓名",
  "email":"电子邮件",
  "password":"密码",
  "mobile":"移动电话",
  "weddingdate":"结婚日期"
}
</pre>
		</dd>
		<dd><span>输出</span> code=2 电子邮件已存在&nbsp;&nbsp;&nbsp;&nbsp;code=3 移动电话已存在
<pre>
{
  "member":{
             "uid":"用户ID",
             "truename":"姓名",
             "email":"电子邮件",
             "mobile":"移动电话",
             "weddingdate":"结婚日期"
           }
}
</pre>
		</dd>
	</dl>

	<a name="api_name_signin"></a>
	<dl id="api_show_signin">
		<dt><a href="#nav">[↑]</a>用户登录</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/guest/signin.php</dd>
		<dd class="datain"><span>输入</span>
<pre>
{
  "email":"电子邮件",
  "password":"密码"
}
</pre>
		</dd>
		<dd><span>输出</span>code=4 电子邮件用户存在但密码错误
<pre>
{
  "member":{
             "uid":"用户ID",
             "truename":"姓名",
             "email":"电子邮件",
             "mobile":"移动电话",
             "weddingdate":"结婚时间"
           },
  "ischeckcode":true | false,
  "isReserved":true | false
}
</pre>
		</dd>
	</dl>

	<a name="api_name_findpassword"></a>
	<dl id="api_show_findpassword">
		<dt><a href="#nav">[↑]</a>找回密码</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/guest/findpassword.php</dd>
		<dd class="datain"><span>输入</span>
<pre>
{
  "email":"电子邮件"
}
</pre>
		</dd>
		<dd><span>输出</span>无，只有邮件成功发送与否状态
		</dd>
	</dl>
</div>

<!-- 注册用户 -->
<div class="api_group_member">
	<a name="api_name_profile"></a>
	<dl id="api_show_profile">
		<dt><a href="#nav">[↑]</a>获取用户资料</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/member/profile.php</dd>
		<dd class="datain"><span>输入</span>无
		</dd>
		<dd><span>输出</span>
<pre>
{
  "member":{
             "uid":"用户ID",
             "truename":"姓名",
             "email":"电子邮件",
             "mobile":"移动电话",
             "weddingdate":"结婚日期"
           }
}
</pre>
		</dd>
	</dl>

	<a name="api_name_changeprofile"></a>
	<dl id="api_show_changeprofile">
		<dt><a href="#nav">[↑]</a>修改用户资料</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/member/changeprofile.php</dd>
		<dd class="datain"><span>输入</span>
<pre>
{
  "truename":"姓名",
  "email":"电子邮件",
  "password":"密码（为空则不修改密码）",
  "mobile":"移动电话",
  "weddingdate":"结婚日期"
}
</pre>
		</dd>
		<dd><span>输出</span>
<pre>
{
  "member":{
             "uid":"用户ID",
             "truename":"姓名",
             "email":"电子邮件",
             "mobile":"移动电话",
             "weddingdate":"结婚日期"
           }
}
</pre>
		</dd>
	</dl>

	<a name="api_name_checkcode"></a>
	<dl id="api_show_checkcode">
		<dt><a href="#nav">[↑]</a>校验验证码是否正确并标记已使用</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/member/checkcode.php</dd>
		<dd class="datain"><span>输入</span><i>（测试数据） test1已过期 test2已使用 test3可使用的验证码</i>
<pre>
{
  "code":"验证码"
}
</pre>
		</dd>
		<dd><span>输出</span>无，只有成功与否状态
		</dd>
	</dl>

	<a name="api_name_ischeckcode"></a>
	<dl id="api_show_ischeckcode">
		<dt><a href="#nav">[↑]</a>查询用户验证码状态</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/member/ischeckcode.php</dd>
		<dd class="datain"><span>输入</span>无
		</dd>
		<dd><span>输出</span>
<pre>
{
  "ischeckcode":true | false
}
</pre>
		</dd>
	</dl>
</div>

<!-- 活动信息 -->
<div class="api_group_activity">
	<a name="api_name_activity"></a>
	<dl id="api_show_activity">
		<dt><a href="#nav">[↑]</a>获取活动信息</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/activity/activity.php</dd>
		<dd class="datain"><span>输入</span>无
		</dd>
		<dd><span>输出</span>
<pre>
{
  "activity":{
               "id":"活动ID",
               "title":"活动标题",
               "giftpic":"礼品图片",
               "giftinfo":"礼品介绍",
               "showimg":"展示图片",
               "preface":"序言（html格式）",
               "content":"活动具体内容（html格式）"
             }
}
</pre>
		</dd>
	</dl>

	<a name="api_name_activityhtml"></a>
	<dl id="api_show_activityhtml">
		<dt><a href="#nav">[↑]</a>获取活动html页面</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/activity/activityhtml.php</dd>
		<dd class="datain"><span>输入</span>
<pre>
{
  "type":"（可选）内容设定 content内容（默认） preface序言"
}
</pre>
		</dd>
		<dd><span>输出</span>活动对应的html页面
		</dd>
	</dl>

	<a name="api_name_site"></a>
	<dl id="api_show_site">
		<dt><a href="#nav">[↑]</a>获取活动场所列表</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/activity/site.php</dd>
		<dd class="datain"><span>输入</span>
<pre>
{
  "order":"（可选）排序方式 vacancies剩余人数（默认） dates活动时间",
  "perpage":"（可选）每页显示数 默认5，0将显示全部",
  "page":"（可选）页数 默认1"
}
</pre>
		</dd>
		<dd><span>输出</span>
<pre>
{
  "sitetotal":"场所总数",
  "sites":[
            {
              "siteid":"场所ID",
              "sitename":"场所名称",
              "begintime":"活动时间",
              "begintime_num":"活动时间linux时间戳",
              "city":"城市",
              "address":"具体地址",
              "telephone":"联系电话",
              "info":"场所介绍",
              "coverimg":"封面图片",
              "latitude":"纬度",
              "longitude":"经度",
              "maxpeoplenum":"最大人数",
              "curpeoplenum":"当前人数",
              "albums":[
                         {
                           "id":"自动编号",
                           "imginfo":"图片描述",
                           "imgfile":"图片地址"
                         }
                       ]
            }
          ]
}
</pre>
		</dd>
	</dl>

	<a name="api_name_reserve"></a>
	<dl id="api_show_reserve">
		<dt><a href="#nav">[↑]</a>用户预定活动场所</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/activity/reserve.php</dd>
		<dd class="datain"><span>输入</span>在活动开始前规定时间可以重复提交修改
<pre>
{
  "siteid":"场所id",
  "peoplenum":"人数"
}
</pre>
		</dd>
		<dd><span>输出</span>无，只有成功与否状态
		</dd>
	</dl>

	<a name="api_name_myreserve"></a>
	<dl id="api_show_myreserve">
		<dt><a href="#nav">[↑]</a>查询用户选定的场所</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/activity/myreserve.php</dd>
		<dd class="datain"><span>输入</span>
<pre>
{
  "flag":"（可选，默认0）0是否预定结果 1包含预定信息 2包含场所信息 4包含活动信息 （1，2，4可按位自由组合）"
}
</pre>
		</dd>
		<dd><span>输出</span>
<pre>
{
  "ischeckcode":true | false,
  "isReserved":true | false,
  "myreserve":{
                "peoplenum":"我的报名人数"
              },
  "site":{
           "siteid":"场所ID",
           "sitename":"场所名称",
           "begintime":"活动时间",
           "begintime_num":"活动时间linux时间戳",
           "reservetime_num":"活动更改截止时间linux时间戳",
           "city":"城市",
           "address":"具体地址",
           "telephone":"联系电话",
           "info":"场所介绍",
           "coverimg":"封面图片",
           "coverimgs":[
                         "图片1",
                         "图片2",
                         "图片3"
                       ],
           "latitude":"纬度",
           "longitude":"经度",
           "maxpeoplenum":"最大人数",
           "curpeoplenum":"当前人数",
           "albums":[
                      {
                        "id":"自动编号",
                        "imginfo":"图片描述",
                        "imgfile":"图片地址"
                      }
                    ]
         },
  "activity":{
               "id":"活动ID",
               "title":"活动标题",
               "giftpic":"礼品图片",
               "giftinfo":"礼品介绍",
               "showimg":"展示图片",
               "preface":"序言（html格式）",
               "content":"活动具体内容（html格式）"
             }
}
</pre>
		</dd>
	</dl>

	<a name="api_name_ischange"></a>
	<dl id="api_show_ischange">
		<dt><a href="#nav">[↑]</a>查询更换预定状态</dt>
		<dd class="apiurl">http://lfly.cn/demo/princesswedding/api/activity/ischange.php</dd>
		<dd class="datain"><span>输入</span>无
		</dd>
		<dd><span>输出</span>
<pre>
{
  "ischange":true | false
}
</pre>
		</dd>
	</dl>
</div>

</div>
</body>
</html>